let container=document.querySelector('.container')
let el='';
fetch('http://chst.vip:1234/api/getgsproduct?shopid=0&areaid=0')
.then(body=>body.json())
.then(res=>{
    res.result.forEach(item=>{
    //    console.log(item.productImg)
        el+=`<li>
        <img src='${item.productImg}'/>
        <p>${item.productName}</p>
        <span>${item.productPrice}</span>
        </li>`
    })
    container.innerHTML=el;
})

// let ul = document.querySelector('ul')
container.addEventListener('click', function (e) {
    // console.log(e)
    const arr = [...e.path].reverse()
    let _this = arr[5]
    // console.log(_this)
    // let id = _this.getAttribute('id')
    // let name = $(_this).find('p').text()
    location.href = 'https://www.baidu.com'
}, false)